package com.futureCloudMOM.controller.core.web.basic;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.common.core.domain.AjaxResult;
import com.futureCloudMOM.common.utils.poi.ExcelUtil;
import com.futureCloudMOM.controller.core.controller.BaseApiController;
import com.futureCloudMOM.core.domain.BasicBillType;
import com.futureCloudMOM.core.service.BasicBillTypeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "订单类型")
@RestController
@RequestMapping("basic/bill_type")
public class BasicBillTypeController extends BaseApiController<BasicBillType, BasicBillType, BasicBillTypeService> {

    public BasicBillTypeController(BasicBillTypeService service) {
        super(service);
    }

    @RequestMapping("/importExcel")
    public AjaxResult importExcel(){
        List<BasicBillType> list = service.list(new LambdaQueryWrapper<BasicBillType>()
        .eq(BasicBillType::getInOutFlag,0));
        ExcelUtil<BasicBillType> excelUtil = new ExcelUtil<>(BasicBillType.class);
        return  excelUtil.exportExcel(list,"订单类型数据");
    }

}
